/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package technotheist.data.wrap;

import technotheist.data.BBuffer;
import technotheist.data.BufferManager;

/**
 *
 * @author Mitch
 */
public class BMatrix3D<T> extends BBufferWrapper<T> {
    public final int X;
    public final int Y;
    public final int Z;
    public final int YZ;

    public BMatrix3D(BBuffer<T> parent, int X, int Y, int Z) {
	super(parent);
	this.X = X;
	this.Y = Y;
	this.Z = Z;
	YZ = Y * Z;
    }

    public T s(int x, int y, int z) {
	return s(x * YZ + y * Z + z);
    }

    public void s(int x, int y, int z, T v) {
	s(x * YZ + y * Z + z, v);
    }
    
    public BMatrix2D<T> createCrossSectionYZ(BufferManager mngr, int x) {
	return mngr.createMatrix2D(this.createSubBuffer(YZ, X * YZ), Y, Z);
    }

}
